package com.arcaneshift.security.errors;

import com.common.security.abstracts.AbstractError;

/**
 * Error code range: 141 - 160
 * 
 * @author Ady
 *
 */
public class GameError extends AbstractError {

	public static final int GAME_NOT_FOUND = 141;
	private static final String MESSAGE_GAME_NOT_FOUND = "The game was not found in the game container";
	private static final String CAUSE_GAME_NOT_FOUND = "The game may have not register for the game container or has already expired";
	private static final String DESCRIPTION_GAME_NOT_FOUND = "Check the game id and try again";
	
	public static final int NO_GAME_PROVIDED = 142;
	private static final String MESSAGE_NO_GAME_PROVIDED = "The game was not provided";
	private static final String CAUSE_NO_GAME_PROVIDED = "The game is missing from the request";
	private static final String DESCRIPTION_NO_GAME_PROVIDED = "Try again to create a new game id";
	
	public GameError(int code) {
		super(code);
		
		switch (code) {
			case GAME_NOT_FOUND: {
				setMessage(MESSAGE_GAME_NOT_FOUND);
				setCause(CAUSE_GAME_NOT_FOUND);
				setDescription(DESCRIPTION_GAME_NOT_FOUND);
				break;
			}
			case NO_GAME_PROVIDED: {
				setMessage(MESSAGE_NO_GAME_PROVIDED);
				setCause(CAUSE_NO_GAME_PROVIDED);
				setDescription(DESCRIPTION_NO_GAME_PROVIDED);
				break;
			}
		}
	}
}
